import request from 'umi-request';

export async function getSecurityRecordReportList(params = {}) {
  let isAllYear = params.isAllYear === 0 ? 0 : 1;
  let operateTime = params.operateTime ? new Date(params.operateTime) : new Date();
  return request('/hr-ssc/api/api-admin/security/getSecurityRecordReportList', {
    method: 'post',
    data: {
      ...params,
      isAllYear,
      operateTime,
      pageNum: params.current,
    },
  }).then((res) => {
    if (res.flag) {
      const data = res.data;
      return {
        current: data.currPage,
        data: data.list,
        pageSize: data.pageSize,
        success: true,
        total: data.totalCount,
      };
    } else {
      return {};
    }
  });
}
